# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=akms
pkgver=0.2.1
pkgrel=0
pkgdesc="Alpine Kernel Module Support"
url="https://github.com/jirutka/akms"
arch="noarch"
license="MIT"
depends="bubblewrap cmd:depmod kernel-hooks"
makedepends="asciidoctor"
triggers="$pkgname.trigger=/usr/src/*"
install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-deinstall"
subpackages="$pkgname-doc"
source="https://github.com/jirutka/akms/archive/v$pkgver/akms-$pkgver.tar.gz
	modules-load.conf
	"
options="!check"  # no tests provided

build() {
	make build
}

package() {
	make install DESTDIR="$pkgdir" prefix=/usr

	# See https://github.com/jirutka/akms/issues/5
	install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/$pkgname.conf
}

sha512sums="
ed66ff111ba8c4c3ee1aa252781089c435b1bbd9ac6c5b38292640e317573713343b2175dcb1ab1c071e9f6caf378589f29f02ed0fd80d4a1f18471fd109c4ca  akms-0.2.1.tar.gz
e61ebacae17e4e6b9ec39c0673d46c7764cba7f1378208341688f201c396a1599f8a518ce0849f36da0de2710391014f45d90ab09f6b36a579970d1672b0d71d  modules-load.conf
"
